home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / edit / aurora2.zip / LONGLINE.AML < prev    next >
Text File  |  1995-01-26  |  1KB  |  46 lines

  1.  
  2. // ───────────────────────────────────────────────────────────────────
  3. // The Aurora Editor v2.0
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // Find the longest line
  7. //
  8. // This macro moves the cursor to the end of the longest line in
  9. // the current window
  10. // ───────────────────────────────────────────────────────────────────
  11.  
  12.   // compile time macros and function definitions
  13.   include bootpath "define.aml"
  14.  
  15.   var maxlength
  16.  
  17.   // test for edit windows
  18.   if not wintype? "edit" then
  19.     msgbox "Edit windows only!"
  20.     return
  21.   end
  22.  
  23.   // make cursor position undo-able and goto file top
  24.   undocursor
  25.   row 1
  26.  
  27.   // do for all lines in the file
  28.   repeat
  29.  
  30.     // if the line length > current longest line..
  31.     if getlinelen > maxlength then
  32.  
  33.       // ..then make it the longest line and save the row
  34.       maxlength = getlinelen
  35.       longestline = getrow
  36.     end
  37.   until not down
  38.  
  39.   // goto to the end of the longest line
  40.   row longestline
  41.   col getlinelen + 1
  42.  
  43.   // use "onfound" (in EXT.AML) to adjust the window view if needed
  44.   send "onfound"
  45.  
  46.